$(document).ready(function(){
    
    var returnFalse = function() {
        return false;
    };

    $(".meta").each(function(){
        var value = $(this).text();
        var p = $(this).parent();
        var namesStr = $(this).attr("class");
        var names = namesStr.split(" ");
        jQuery.each(names, function(index, name){
            if (name != "meta") {
                if (name.indexOf("json-") == 0) {
                    value = jQuery.parseJSON(value);
                }
                p.data(name, value);
            }
        });
    });
    $(".link").each(function(){
        var url = $(this).children(".url").text();
        url = window.location.protocol + "//" + window.location.host + url;
        $(this).click(function() {
            window.location = url;
        });
    });
    $(".readonly").click(returnFalse);
    $(".readonly").keydown(returnFalse);

});
